package com.ycz.master.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.ycz.master.pojo.User;
import com.ycz.master.pojo.UserAndDatafiling;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserAndDataFilingMapper extends BaseMapper<UserAndDatafiling> {
    @Select("select u.*,d.type_name,d.create_time from user u\n" +
            " LEFT  JOIN\n" +
            "\t(select a.type_name,a.assessment_type_id,d.user_id ,d.create_time from assessmentType a LEFT JOIN dataFiling d on a. assessment_type_id=d.assessment_type_a) d \n" +
            "\ton  u.user_id=d.user_id order by u.user_id desc")
    List<UserAndDatafiling> findall();


    @Select("select u.*,d.type_name,d.create_time,d.assessment_type_b,d.assessment_type_a from user u \n" +
            "LEFT  JOIN\n" +
            "(select a.type_name,a.assessment_type_id,d.user_id ,d.assessment_type_b,d.assessment_type_a,d.create_time from  \n" +
            " dataFiling d \n" +
            " LEFT JOIN \n" +
            " assessmentType a on a. assessment_type_id=d.assessment_type_b) d \n" +
            "on  u.user_id=d.user_id where d.assessment_type_a=4 order by u.user_id desc")
    List<UserAndDatafiling> bankfindall();
}
